﻿// PoeChar object by Mouse ~12/11/13 initial
//                          01/14/14 current

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;


namespace PoeThing
{
    [Serializable()]
    public class PoeChar
    {
        public string charName, charClass;
        public int level, baseStr, baseDex, baseInt;
        public int CI, IR, EB, AC, ZO, BM, NA, DW, Ranged, Cruel, Merc;
        public decimal finalStr, finalDex, finalInt;
        public decimal baseLife, baseMana, baseRegen, baseManaRegen;
        public decimal baseArmor, baseEvade, baseES, ArmorPlusEvade, baseGrace, ArmorMore, ESMore;
        public decimal bonusShieldAllP, bonusShieldESP, extraShieldArm, extraShieldEva, extraShieldES;
        public decimal[] LifeAdd, LifeAddP, RegAdd, RegAddP, ManaAdd, ManaAddP, ManaRegAdd, ManaRegAddP;
        public decimal[] StrAdd, StrAddP, DexAdd, DexAddP, IntAdd, IntAddP;
        public decimal[] ArmorAdd, ArmorAddP, EvadeAdd, EvadeAddP, ESAdd, ESAddP;
        public decimal[] blockAdd, spellBlockAdd, dodgeAdd, spellDodgeAdd;
        public decimal[] FireAdd, FireMaxAdd, ColdAdd, ColdMaxAdd, LightAdd, LightMaxAdd, ChaosAdd;
        public decimal[] IIRAdd, IIQAdd, moveAdd, minionDamage, minionLife, minionSpeed; 
        public decimal[] reducedReserve, auraStrength, buffStrength, buffDuration, skillDuration;
        public decimal[] auraPur1, auraPur2, auraPur3, auraHas1, auraHas2, auraHas3, auraAng1, auraAng2, auraWra1, auraWra2;
        public decimal[] auraDisc, auraGrac, auraHatr, auraDete, auraVita, auraClar, auraTem1, auraTem2;
        public decimal[] Anger, Wrath, Purity, PurFire, PurCold, PurLight, Haste, Discipline, Grace, Hatred, Determination, Vitality, Clarity, TempShld;
        public decimal[] castSpeed, attackSpeed, accAdd, accAddP;
        public decimal[] dmgPhysP, dmgSpellP, dmgMeleePhysP, dmgWeapPhysP, dmgProjP, dmgElemP, dmgFireP, dmgColdP, dmgLightP, dmgChaosP;
        public decimal[] dmgPhysAddMin, dmgPhysAddMax, dmgFireAddMin, dmgFireAddMax, dmgColdAddMin, dmgColdAddMax, dmgLightAddMin, dmgLightAddMax, dmgChaosAddMin, dmgChaosAddMax;
        public decimal igniteChance, igniteDuration, igniteDamage, shockChance, shockDuration, freezeChance, freezeDuration, chillDuration;
        public decimal mainHAPS, offHAPS, mainHPhysMin, mainHPhysMax, offHPhysMin, offHPhysMax, mainHCrit, offHCrit, facebreaker, areaSize, areaDamage, trapDamage, dotDamage;
        public decimal[] critP, critMultP, critSpellP, critMultSpellP, critWeaponP, critMultWeaponP;
        public decimal baseAPS, baseCastTime, baseCritAtk, baseCritSpell, baseCritMult;
        
        public PoeChar()
        {
            NewChar();
        }

        public void NewChar()
        {
            //VARIABLES
            // use <##.##>m for decimal declarations: decimal[] x = {39.99m, 29.99m };
            // refer with Stats.LifeAdd
            charName = "Default";
            charClass = "";
            level = 1;
            baseStr = baseDex = baseInt = 0;
            finalStr = finalDex = finalInt = 0;
            baseLife = baseRegen = baseMana = baseManaRegen = 0.0m;
            // CI = chaos induction, IR = iron reflexes, EB = eldritch battery
            // AC = acro (counts phase acro), BM = blood magic, NA = necromantic aegis
            // DW = duel wield, Cruel = -20 res all, Merc = -40 res all
            CI = IR = EB = AC = ZO = NA = BM = DW = Ranged = Cruel = Merc = 0;
            LifeAdd = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            LifeAddP = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            RegAdd = new decimal[] { 0.0m, 0.0m, 0.0m, 0.0m, 0.0m, 0.0m, 0.0m, 0.0m, 0.0m, 0.0m, 0.0m };
            RegAddP = new decimal[] { 0.0m, 0.0m, 0.0m, 0.0m, 0.0m, 0.0m, 0.0m, 0.0m, 0.0m, 0.0m, 0.0m };
            ManaAdd = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            ManaAddP = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            ManaRegAdd = new decimal[] { 0.0m, 0.0m, 0.0m, 0.0m, 0.0m, 0.0m, 0.0m, 0.0m, 0.0m, 0.0m, 0.0m };
            ManaRegAddP = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            StrAdd = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            StrAddP = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            DexAdd = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            DexAddP = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            IntAdd = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            IntAddP = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };                     
            baseArmor = baseES = ArmorPlusEvade = baseGrace = ArmorMore = ESMore = 0;
            baseEvade = 50; // + 3/level
            bonusShieldAllP = bonusShieldESP = extraShieldArm = extraShieldES = extraShieldEva = 0;
            ArmorAdd = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            ArmorAddP = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            EvadeAdd = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            EvadeAddP = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            ESAdd = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            ESAddP = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            blockAdd = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            spellBlockAdd = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            dodgeAdd = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            spellDodgeAdd = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            FireAdd = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            FireMaxAdd = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            ColdAdd= new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            ColdMaxAdd = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            LightAdd = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            LightMaxAdd = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            ChaosAdd = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            //                         1     2     3     4     5     6     7     8     9     10    11    12    13    14    15    16    17    18    19    20    21    22    23    24    25    26
            auraPur1 = new decimal[] { 0012, 0013, 0014, 0015, 0016, 0017, 0018, 0019, 0020, 0020, 0021, 0022, 0023, 0024, 0025, 0025, 0026, 0027, 0027, 0028, 0029, 0029, 0029, 0029, 0029, 0029 };
            auraPur2 = new decimal[] { 0020, 0021, 0022, 0023, 0024, 0025, 0026, 0027, 0028, 0029, 0030, 0031, 0032, 0033, 0034, 0035, 0036, 0037, 0038, 0039, 0040, 0041, 0042, 0043, 0044, 0045 };
            auraPur3 = new decimal[] { 0000, 0000, 0000, 0000, 0001, 0001, 0001, 0001, 0001, 0001, 0002, 0002, 0002, 0002, 0002, 0002, 0003, 0003, 0003, 0004, 0004, 0004, 0005, 0005, 0005, 0005 };
            auraHas1 = new decimal[] { 0004, 0004, 0004, 0005, 0005, 0005, 0006, 0006, 0006, 0007, 0007, 0007, 0008, 0008, 0008, 0008, 0008, 0008, 0008, 0009, 0009, 0009, 0010, 0010, 0010, 0010 };//Move%
            auraHas2 = new decimal[] { 0009, 0010, 0010, 0010, 0011, 0011, 0011, 0012, 0012, 0012, 0013, 0013, 0013, 0014, 0014, 0015, 0015, 0016, 0016, 0016, 0017, 0017, 0017, 0017, 0017, 0017 };//Atk%
            auraHas3 = new decimal[] { 0009, 0009, 0010, 0010, 0010, 0011, 0011, 0011, 0012, 0012, 0012, 0013, 0013, 0013, 0014, 0014, 0015, 0015, 0016, 0016, 0016, 0017, 0017, 0017, 0017, 0017 };//Cast%
            auraAng1 = new decimal[] { 0005, 0007, 0008, 0010, 0012, 0014, 0016, 0020, 0024, 0029, 0035, 0040, 0045, 0052, 0058, 0066, 0074, 0080, 0087, 0094, 0094, 0109, 0109, 0109, 0109, 0109 };//Min
            auraAng2 = new decimal[] { 0009, 0011, 0014, 0016, 0020, 0023, 0027, 0033, 0041, 0049, 0058, 0067, 0076, 0086, 0097, 0110, 0124, 0134, 0145, 0156, 0156, 0182, 0182, 0182, 0182, 0182 };//Max
            auraWra1 = new decimal[] { 0001, 0001, 0002, 0002, 0002, 0003, 0003, 0004, 0005, 0005, 0007, 0007, 0009, 0010, 0011, 0012, 0014, 0015, 0016, 0018, 0019, 0021, 0022, 0024, 0026, 0026 };//Min
            auraWra2 = new decimal[] { 0016, 0020, 0025, 0030, 0035, 0042, 0049, 0060, 0073, 0088, 0105, 0120, 0136, 0155, 0175, 0198, 0223, 0241, 0261, 0282, 0304, 0328, 0354, 0381, 0411, 0411 };//Max
            auraDisc = new decimal[] { 0090, 0099, 0108, 0117, 0128, 0137, 0147, 0159, 0170, 0182, 0194, 0206, 0219, 0231, 0245, 0260, 0273, 0288, 0303, 0318, 0333, 0350, 0366, 0366, 0366, 0366 };
            auraGrac = new decimal[] { 0395, 0468, 0546, 0630, 0720, 0816, 0918, 1026, 1140, 1259, 1383, 1448, 1514, 1581, 1650, 1721, 1793, 1866, 1940, 2016, 2091, 2166, 2241, 2241, 2241, 2241 };
            auraDete = new decimal[] { 0032, 0033, 0034, 0035, 0036, 0037, 0038, 0039, 0040, 0041, 0042, 0043, 0044, 0045, 0046, 0047, 0048, 0049, 0050, 0051, 0052, 0053, 0054, 0055, 0056, 0057 };
            auraHatr = new decimal[] { 0026, 0026, 0027, 0027, 0028, 0028, 0029, 0029, 0030, 0030, 0031, 0031, 0032, 0032, 0033, 0034, 0034, 0035, 0035, 0036, 0036, 0037, 0037, 0038, 0038, 0038 };
            auraVita = new decimal[] { .70m, .75m, .80m, .85m, .90m, .95m, 1.0m, 1.05m,1.10m,1.15m,1.20m,1.25m,1.30m,1.35m,1.40m,1.45m,1.50m,1.55m,1.60m,1.65m,1.70m,1.75m,1.80m,1.85m,1.90m,1.95m };
            auraClar = new decimal[] { 3.0m, 3.9m, 4.9m, 5.9m, 6.9m, 7.9m, 8.9m, 10.3m,11.8m,13.3m,14.8m,15.9m,17.1m,18.3m,19.5m,20.8m,22.0m,22.9m,23.9m,24.6m,25.5m,25.5m,25.5m,25.5m,25.5m,25.5m };
            auraTem1 = new decimal[] { 0009, 0011, 0013, 0016, 0019, 0023, 0027, 0032, 0039, 0047, 0056, 0064, 0072, 0082, 0092, 0104, 0117, 0126, 0136, 0147, 0147, 0147, 0147, 0147, 0147, 0147 };//Min
            auraTem2 = new decimal[] { 0013, 0017, 0020, 0024, 0029, 0034, 0040, 0049, 0059, 0070, 0084, 0096, 0108, 0123, 0138, 0156, 0175, 0189, 0204, 0220, 0220, 0220, 0220, 0220, 0220, 0220 };//Max
            // cost, level, % mana reduced, % blood magic, modified effects
            // 0 = level, 1 = reduced amount, 2 = blood magic amount, 3=base cost%, 4 = eff1, 5 = eff2, 6 = eff3
            // 1 effect
            Discipline = new decimal[] { 0, 100, 0, 60, 0 };
            Grace = new decimal[] { 0, 100, 0, 60, 0 };
            Determination = new decimal[] { 0, 100, 0, 60, 0 }; 
            Hatred = new decimal[] { 0, 100, 0, 60, 0 };
            Purity = Vitality = new decimal[] { 0, 100, 0, 40, 0 };
            Clarity = new decimal[] { 0, 100, 0, 0, 0 }; // Clarity cost = 40+ (level*20)
            // 2 effects
            Anger = new decimal[] { 0, 100, 0, 60, 0, 0 };
            Wrath = new decimal[] { 0, 100, 0, 60, 0, 0 };
            PurFire = new decimal[] { 0, 100, 0, 40, 0, 0 };
            PurCold = new decimal[] { 0, 100, 0, 40, 0, 0 };
            PurLight = new decimal[] { 0, 100, 0, 40, 0, 0 };
            // 3 effects
            Haste = new decimal[] { 0, 100, 0, 60, 0, 0, 0 };
            TempShld = new decimal[] { 0, 100, 0, 25, 0, 0, 0 };
            reducedReserve = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            auraStrength = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            buffStrength = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            buffDuration = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            skillDuration = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            IIRAdd = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            IIQAdd = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            moveAdd = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            minionDamage = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            minionLife = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            minionSpeed = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

            castSpeed= new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            attackSpeed = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            accAdd = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            accAddP = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            
            dmgPhysP = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            dmgSpellP = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            dmgMeleePhysP = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            dmgWeapPhysP = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            dmgProjP = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            dmgElemP = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            dmgFireP = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            dmgColdP = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            dmgLightP = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            dmgChaosP = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };


            dmgPhysAddMin = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            dmgPhysAddMax = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            dmgFireAddMin = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            dmgFireAddMax = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            dmgColdAddMin = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            dmgColdAddMax = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            dmgLightAddMin = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            dmgLightAddMax = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            dmgChaosAddMin = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            dmgChaosAddMax = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

            igniteChance = igniteDuration = igniteDamage = shockChance = shockDuration = freezeChance = freezeDuration = chillDuration= 0;
            areaSize = areaDamage = trapDamage = dotDamage = 0;
            critP = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            critMultP = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            critSpellP = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            critMultSpellP = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            critWeaponP = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
            critMultWeaponP = new decimal[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

            baseAPS = mainHAPS = offHAPS = 1;
            mainHPhysMin = mainHPhysMax =  offHPhysMin = offHPhysMax= 0;
            baseCastTime = 1;
            baseCritAtk = mainHCrit = offHCrit = 5;
            facebreaker = 0;
            baseCritSpell = 5;
            baseCritMult = 150;
            
        }

        public void changeClass(string cl)
        {
            charClass = cl;
            switch (cl)
            {
                case "Scion":
                    baseStr = baseDex = baseInt = 20;
                    break;
                case "Marauder":
                    baseStr = 32;
                    baseDex = baseInt = 14;
                    break;
                case "Ranger":
                    baseStr = baseInt = 14;
                    baseDex = 32;
                    break;
                case "Witch":
                    baseStr = baseDex = 14;
                    baseInt = 32;
                    break;
                case "Duelist":
                    baseStr = baseDex = 23;
                    baseInt = 14;
                    break;
                case "Templar":
                    baseStr = baseInt = 23;
                    baseDex = 14;
                    break;
                case "Shadow":
                    baseStr = 14;
                    baseDex = baseInt = 23;
                    break;
            }
        }

        public string strBaseStr()
        {
            return Convert.ToString(baseStr);
        }
        public string strStrAddSum()
        {
            return Convert.ToString(StrAdd.Sum());
        }
        public string strBaseDex()
        {
            return Convert.ToString(baseDex);
        }
        public string strDexAddSum()
        {
            return Convert.ToString(DexAdd.Sum());
        }
        public string strBaseInt()
        {
            return Convert.ToString(baseInt);
        }
        public string strIntAddSum()
        {
            return Convert.ToString(IntAdd.Sum());
        }
        public string strFinalStr()
        {
            // add in array sum for gear str later, ETC
//            MessageBox.Show("BaseStr" + baseStr + "\nfinalStr:"+finalStr+"\nStrAdd.Sum:"+StrAdd.Sum()+"\nStrAddP.Sum:"+StrAddP.Sum());
            finalStr = Convert.ToDecimal(baseStr) + StrAdd.Sum();
            if(StrAddP.Sum() > 0) finalStr = finalStr * (1 + (StrAddP.Sum() / 100));
            return finalStr.ToString("0");
        }
        public string strStatsPhys()
        {
            return (finalStr / 5).ToString("0.0");
        }
        public string strStatsLife()
        {
            return (finalStr / 2).ToString("0.0");
        }
        public string strFinalDex()
        {
            finalDex = Convert.ToDecimal(baseDex) + DexAdd.Sum();
            if(DexAddP.Sum() > 0) finalDex = finalDex * (1 + (DexAddP.Sum() / 100));
            return finalDex.ToString("0");
        }
        public string strStatsEvade()
        {
            return (finalDex / 5).ToString("0.0");
        }
        public string strStatsAcc()
        {
            return (finalDex * 2).ToString("0.0");
        }
        public string strFinalInt()
        {
            finalInt = Convert.ToDecimal(baseInt) + IntAdd.Sum();
            if(IntAddP.Sum() > 0) finalInt= finalInt * (1 + (IntAddP.Sum() / 100));
            return finalInt.ToString("0");
        }
        public string strStatsES()
        {
            return (finalInt / 5).ToString("0.0");
        }
        public string strStatsMana()
        {
            return (finalInt / 2).ToString("0.0");
        }
        public void updateBaseLife()
        {
            decimal tempLvl;
            tempLvl = Convert.ToDecimal(level - 1);            
            baseLife = 50 + (8 * tempLvl) + (finalStr / 2);
        }
        public void updateBaseMana()
        {
            decimal tempLvl;
            tempLvl = Convert.ToDecimal(level - 1);
            baseMana = 40 + (4 * tempLvl) + (finalInt / 2);
        }
        public string strManaEB()
        {
            decimal tm = 0;
            if (EB == 1)
            {
                tm = Convert.ToDecimal(strEsAdjusted());
                tm = tm * (1 + (ESAddP.Sum() + (finalInt / 5) + ManaAddP.Sum()) / 100);
                // Ignore CI more ES
                // tm = tm * (1 + ESMore / 100);
                // add in mana mults
                if (AC == 1) // cut EB contribution in half if they have acro
                    tm = tm / 2;                
            }
            return tm.ToString("0");
        }

        public string strBaseLife()
        {
            return baseLife.ToString("0");
        }
        public string strBaseMana()
        {
            return baseMana.ToString("0");
        }
        public string strBaseRegen()
        {
            return "0";
        }
        public string strBaseManaRegen()
        {
            return (decManaFinal() * .0175m).ToString("0.00");
        }
        public decimal decBaseManaRegen()
        {
            return decManaFinal() * .0175m;
        }

        public string strLifeAddSum()
        {
            return Convert.ToString(LifeAdd.Sum());
        }
        public string strManaAddSum()
        {
            return Convert.ToString(ManaAdd.Sum());
        }
        public string strLifeAddPSum()
        {
            return Convert.ToString(LifeAddP.Sum()) + "%";
        }
        public string strManaAddPSum()
        {
            return Convert.ToString(ManaAddP.Sum()) + "%";
        }
        public string strLifeFinal()
        {
            //MessageBox.Show("baselife: "+baseLife+"\nLifeAdd.sum: "+LifeAdd.Sum()+"\nLifeAddP.Sum:"+LifeAddP.Sum());
            if (CI == 1) return "1";
            else 
                return ((baseLife + LifeAdd.Sum()) * (1 + LifeAddP.Sum() / 100)).ToString("0");
        }
        public string strManaFinal()
        {
            return decManaFinal().ToString("0");
        }
        public decimal decLifeFinal()
        {
            if (CI == 1) return 1;
            else
                return ((baseLife + LifeAdd.Sum()) * (1 + LifeAddP.Sum() / 100));
        }
        public decimal decManaFinal()
        {
            decimal tm;
            tm = ((baseMana + ManaAdd.Sum()) * (1 + ManaAddP.Sum() / 100));
            if (BM == 1) tm = 0;
            else if (EB == 1)
                tm = tm + Convert.ToDecimal(strManaEB());
            return tm;
        }
        public string strRegAddSum()
        {
            return Convert.ToString(RegAdd.Sum());
        }
        public string strManaRegAddSum()
        {
            return Convert.ToString(ManaRegAdd.Sum());
        }
        public string strRegAddPSum()
        {
            return (RegAddP.Sum()).ToString("0.00") + "%";
        }
        public string strManaRegAddPSum()
        {
            return (ManaRegAddP.Sum()).ToString("0.00") + "%";
        }
        public string strRegOther()
        {
            return strAuraEffects("Vitality")[0];
        }
        public string strManaRegenOther()
        {
            decimal te = 0;
            te = Clarity[4];
            if(buffStrength.Sum() > 0 || auraStrength.Sum() > 0)
                te = te * (1 + (buffStrength.Sum() + auraStrength.Sum()) / 100);
            return te.ToString("0");
        }
        public string strRegenFinal()
        {
            decimal lifeTotal = (baseLife + LifeAdd.Sum()) * (1 + LifeAddP.Sum() / 100);
            decimal regenTotal = (RegAddP.Sum() + decAuraEffects("Vitality")[0]) / 100;
            if (ZO == 1) return "0";
            else 
                return (RegAdd.Sum() + (lifeTotal * regenTotal)).ToString("0.00");
        }
        public string strESRegenFinal()
        {
            decimal esTotal = 0, tr = 0;
            if (ZO == 1)
            {
                esTotal = Convert.ToDecimal(strESFinal());
                tr = (RegAdd.Sum() + (esTotal * (RegAddP.Sum()+ decAuraEffects("Vitality")[0]) / 100));
            }
            return tr.ToString("0.00");

        }
        public string strManaRegenFinal()
        {
            //  ( (total mana * 1.05/60) + (manaregadd.sum) ) * (1+ManaAddP.sum()/100);
            // 
            decimal modifiedAdd = decBaseManaRegen() + ManaRegAdd.Sum() + Convert.ToDecimal(strManaRegenOther());
            return (modifiedAdd * (1 + ManaRegAddP.Sum() / 100)).ToString("0.00");
        }
        // -------------- ARMOR-------------------------------------------
        public void calcShieldExtras()
        {
            decimal ts = 0;
            if (DW == 0) //if not dual wielding
            {
                ts = ArmorAdd[3] * (1 + (bonusShieldAllP / 100));
                ts = ts - ArmorAdd[3];
                extraShieldArm = ts;
                ts = EvadeAdd[3] * (1 + (bonusShieldAllP / 100));
                ts = ts - EvadeAdd[3];
                extraShieldEva = ts;
                ts = ESAdd[3] * (1 + ((bonusShieldAllP + bonusShieldESP) / 100));
                ts = ts - ESAdd[3];
                extraShieldES = ts;
            }
            else
            {
                extraShieldArm = extraShieldEva = extraShieldES = 0;
            }
        }
        public string strExtraShieldArm()
        {
            return extraShieldArm.ToString("0");
        }
        public string strExtraShieldEva()
        {
            return extraShieldEva.ToString("0");
        }
        public string strExtraShieldES()
        {
            return extraShieldES.ToString("0");
        }

        public string strArmorAddSum()
        {
            return Convert.ToString(ArmorAdd.Sum());
        }
        public string strArmorAddPSum()
        {
            return (ArmorAddP.Sum()).ToString("0.00") + "%";
        }
        public string strArmorPlusEvade()
        {
            return ArmorPlusEvade.ToString("0.00");
        }
        public string strArmorTotalP()
        {
            return (ArmorPlusEvade + ArmorAddP.Sum()).ToString("0.00") + "%";
        }
        public string strIronReflexes()
        {
            if (IR == 1)
            {
                // from http://pathofexile.gamepedia.com/Iron_Reflexes
                // evasion + (1 + total evade% + total armor% + armorandevade%)
                return ((EvadeAdd.Sum() + baseEvade + baseGrace + extraShieldEva) * (1+ (EvadeAddP.Sum()+ ArmorAddP.Sum()+ArmorPlusEvade)/100)).ToString("0"); 
            }
            else return "0";
        }

        public string strArmorAdjusted()
        {
            decimal ta = 0;
            ta = baseArmor + ArmorAdd.Sum() + extraShieldArm;
            ta = ta * (1 + (ArmorAddP.Sum() + ArmorPlusEvade) / 100);
            if(IR==1)
                ta = ta + ((EvadeAdd.Sum() + baseEvade + baseGrace +extraShieldEva) * (1 + (EvadeAddP.Sum() + ArmorAddP.Sum() + ArmorPlusEvade) / 100));

            return ta.ToString("0");
        }
        public string strArmorMore()
        {
            return ArmorMore.ToString("00") + "%";
        }
        public string strArmorFinal()
        {
            decimal ta = 0;
            //GEAR
            ta = baseArmor + ArmorAdd.Sum() + extraShieldArm;
            //NODE %armor bonuses
            ta = ta * (1 + (ArmorAddP.Sum() + ArmorPlusEvade) / 100);
            //IR & GRACE
            if (IR == 1)
            {
                // armor & node evade - DO NOT USE DEX BONUS
                ta = ta + (EvadeAdd.Sum() + baseGrace+baseEvade+extraShieldEva) * (1 + (EvadeAddP.Sum() + ArmorAddP.Sum() + ArmorPlusEvade) / 100);
            }
            // DETERMINATION
            if(ArmorMore > 0) 
                ta = ta * (1 + (ArmorMore / 100));
            // ACRO
            if (AC == 1)
                ta = ta / 2;
            return ta.ToString("0");
        }
        public string strEvadeAddSum()
        {
            return Convert.ToString(EvadeAdd.Sum());
        }
        public string strEvadeAddPSum()
        {
            return (EvadeAddP.Sum()).ToString("0.00") + "%";
        }
        public string strGrace()
        {
            return baseGrace.ToString("0.00");
        }

        public string strEvadeTotalP()
        {
            // AR+EV%  + node/gear evade % + dex/5 %
            return (ArmorPlusEvade + EvadeAddP.Sum() + (finalDex / 5)).ToString("0.00") + "%";
        }
        public string strEvadeFinal()
        {
            decimal te = 0;
            if (IR == 1) return "0";
            te = baseEvade + baseGrace + EvadeAdd.Sum() + extraShieldEva;
            te = te *(1 + (ArmorPlusEvade + EvadeAddP.Sum() + (finalDex / 5))/100);
            return te.ToString("0");
        }

        public string strESAddSum()
        {
            return Convert.ToString(ESAdd.Sum());
        }
        public string strESAddPSum()
        {
            return (ESAddP.Sum()).ToString("0.00") + "%";
        }
        public string strESDiscipline()
        {
            decimal te = 0;
            te = Discipline[4];
            if(buffStrength.Sum() > 1 || auraStrength.Sum() > 1)    
                te = te * (1 + (buffStrength.Sum() + auraStrength.Sum() ) / 100);            
            return te.ToString("0");
        }

        public string strESTotalP()
        {
            return (ESAddP.Sum() + (finalInt / 5)).ToString("0.00") + "%";
        }
        public string strEsAdjusted()
        {
            decimal te = 0;
            te = baseES + ESAdd.Sum() + extraShieldES + Convert.ToDecimal(strESDiscipline());
            te = te * (1 + (ESAddP.Sum() + (finalInt / 5)) / 100);
            return te.ToString("0");
        }
        public string strESMore()
        {
            return ESMore.ToString("0")+"%";
        }
        public string strESFinal()
        {
            decimal te = 0;
            te = Convert.ToDecimal(strEsAdjusted());
            te = te * (1 + ESMore / 100);
            // ACRO cuts ES in half
            if (AC == 1)
                te = te / 2;
            // EB removes ES (adds to mana)
            if (EB == 1) 
                te = 0;
            return te.ToString("0");
        }
        public string strResBase()
        {
            Decimal tr = 0;
            if (Cruel == 1) tr = tr - 20;
            if (Merc == 1)  tr = tr - 40;
            return tr.ToString("0");
        }



        public string strFireAddSum()
        {
            return (FireAdd.Sum()).ToString("0") + "%";
        }
        public string strFireGearSum()
        {
            return (FireAdd.Sum() - FireAdd[10]).ToString("0") + "%";
        }
        public string strFireCap()
        {
            return (75 + FireMaxAdd.Sum() + decAuraEffects("PurityofFire")[1]).ToString("0") + "%";
        }
        public string strColdAddSum()
        {
            return (ColdAdd.Sum()).ToString("0") + "%";
        }
        public string strColdGearSum()
        {
            return (ColdAdd.Sum() - ColdAdd[10]).ToString("0") + "%";
        }
        public string strColdCap()
        {
            return (75+ColdMaxAdd.Sum()+decAuraEffects("PurityofIce")[1]).ToString("0") + "%";
        }
        public string strLightAddSum()
        {
            return (LightAdd.Sum()).ToString("0") + "%";
        }
        public string strLightGearSum()
        {
            return (LightAdd.Sum() - LightAdd[10]).ToString("0") + "%";
        }
        public string strLightCap()
        {
            return (75 + LightMaxAdd.Sum() + decAuraEffects("PurityofLightning")[1]).ToString("0") + "%";
        }
        public string strChaosAddSum()
        {
            return (ChaosAdd.Sum()).ToString("0") + "%";
        }
        public string strChaosGearSum()
        {
            return (ChaosAdd.Sum() - ChaosAdd[10]).ToString("0") + "%";
        }
        public string strChaosCap()
        {
            if (CI == 1) return "100%";
            else return "75%";
        }
        public string strFireTotal()
        {
            decimal tr = 0;
            if (Cruel == 1) tr = tr - 20;
            if (Merc == 1) tr = tr - 40;
            tr = tr + FireAdd.Sum() + decAuraEffects("Purity")[0] + decAuraEffects("PurityofFire")[0];
            return tr.ToString("0") + "%";
        }
        public string strColdTotal()
        {
            decimal tr = 0;
            if (Cruel == 1) tr = tr - 20;
            if (Merc == 1) tr = tr - 40;
            tr = tr + ColdAdd.Sum() + decAuraEffects("Purity")[0] + decAuraEffects("PurityofIce")[0];
            return tr.ToString("0") + "%";
        }
        public string strLightTotal()
        {
            decimal tr = 0;
            if (Cruel == 1) tr = tr - 20;
            if (Merc == 1) tr = tr - 40;
            tr = tr + LightAdd.Sum() + decAuraEffects("Purity")[0] + decAuraEffects("PurityofLightning")[0];
            return tr.ToString("0") + "%";
        }
        public string strFireCapped()
        {
            decimal tr = 0;
            decimal tmax = 75 + FireMaxAdd.Sum()+decAuraEffects("PurityofFire")[1];
            if (Cruel == 1) tr = tr - 20;
            if (Merc == 1) tr = tr - 40;
            tr = tr + FireAdd.Sum() + decAuraEffects("Purity")[0]+decAuraEffects("PurityofFire")[0];
            if (tr > tmax) tr = tmax;
            return tr.ToString("0")+"%";
        }
        public string strColdCapped()
        {
            decimal tr = 0;
            decimal tmax = 75 + ColdMaxAdd.Sum() + decAuraEffects("PurityofIce")[1];
            if (Cruel == 1) tr = tr - 20;
            if (Merc == 1) tr = tr - 40;
            tr = tr + ColdAdd.Sum() + decAuraEffects("Purity")[0]+decAuraEffects("PurityofIce")[0];;
            if (tr > tmax) tr = tmax;
            return tr.ToString("0") + "%";
        }
        public string strLightCapped()
        {
            decimal tr = 0;
            decimal tmax = 75 + LightMaxAdd.Sum() + decAuraEffects("PurityofLightning")[1];
            if (Cruel == 1) tr = tr - 20;
            if (Merc == 1) tr = tr - 40;
            tr = tr + LightAdd.Sum() + decAuraEffects("Purity")[0] + decAuraEffects("PurityofLightning")[0]; 
            if (tr > tmax) tr = tmax;
            return tr.ToString("0") + "%";
        }
        public string strChaosCapped()
        {
            decimal tr = 0;
            if (CI == 1) return "100%";
            if (Cruel == 1) tr = tr - 20;
            if (Merc == 1) tr = tr - 40;
            tr = tr + ChaosAdd.Sum();
            if (tr > 75) tr = 75;
            return tr.ToString("0") + "%";
        }

        public string strBlockGear()
        {
            return (blockAdd.Sum()-blockAdd[10]).ToString("0") +"%";
        }
        public string strBlockNode()
        {
            return blockAdd[10].ToString("0") +"%";;
        }
        public string strBlockTotal()
        {
            return ((DW*15)+blockAdd.Sum() + TempShld[6]).ToString("0") + "%"; ;
        }
        public string strDodgeTotal()
        {
            return (dodgeAdd.Sum()).ToString("0") + "%"; ;
        }
        public string strReducedReserve()
        {
            return reducedReserve.Sum().ToString("0");
        }

        public void setAura(string AuraName, decimal alvl)
        {
            switch(AuraName)
            {
                case "Anger":
                    if (alvl < 1)
                        Anger = new decimal[] { 0, 100, 0, 60, 0, 0 };
                    else
                    {
                        Anger[0] = alvl;
                        Anger[4] = auraAng1[(int)alvl - 1];
                        Anger[5] = auraAng2[(int)alvl - 1];
                    }
                    break;
                case "Clarity":
                    if (alvl < 1)
                        Clarity = new decimal[] { 0, 100, 0, 0, 0 };
                    else
                    {
                        Clarity[0] = alvl;
                        Clarity[3] = 40 + (Clarity[0] * 20); // set base cost
                        Clarity[4] = auraClar[(int)alvl - 1];
                    }
                    break;
                case "Determination":
                    if (alvl < 1)
                    {
                        Determination = new decimal[] { 0, 100, 0, 60, 0 };
                        ArmorMore = 0;
                    }
                    else
                    {
                        Determination[0] = alvl;
                        Determination[4] = auraDete[(int)alvl - 1];
                        if(auraStrength.Sum() > 0 || buffStrength.Sum() > 0)
                            ArmorMore = Determination[4] * (1 +(auraStrength.Sum() + buffStrength.Sum())/100);
                        else
                            ArmorMore = Determination[4];
                        
                    }
                    break;
                case "Discipline":
                    if (alvl < 1)
                        Discipline = new decimal[] { 0, 100, 0, 60, 0 };
                    else
                    {
                        Discipline[0] = alvl;
                        Discipline[4] = auraDisc[(int)alvl - 1];
                    }
                    break;
                case "Grace":
                    if (alvl < 1)
                    {
                        Grace = new decimal[] { 0, 100, 0, 60, 0 };
                        baseGrace = 0;
                    }
                    else
                    {
                        Grace[0] = alvl;
                        Grace[4] = auraGrac[(int)alvl - 1];
                        if (auraStrength.Sum() > 0 || buffStrength.Sum() > 0)
                            baseGrace = Grace[4] * (1 + (auraStrength.Sum() + buffStrength.Sum()) / 100);
                        else
                            baseGrace = Grace[4];
                    }
                    break;
                case "Haste":
                    if (alvl < 1)
                        Haste = new decimal[] { 0, 100, 0, 60, 0, 0, 0 };
                    else
                    {
                        Haste[0] = alvl;
                        Haste[4] = auraHas1[(int)alvl - 1];
                        Haste[5] = auraHas2[(int)alvl - 1];
                        Haste[6] = auraHas3[(int)alvl - 1];
                    }
                    break;
                case "Hatred":
                    if (alvl < 1)
                        Hatred = new decimal[] { 0, 100, 0, 60, 0 };
                    else
                    {
                        Hatred[0] = alvl;
                        Hatred[4] = auraHatr[(int)alvl - 1];
                    }
                    break;
                case "Purity":
                    if (alvl < 1)
                        Purity = new decimal[] { 0, 100, 0, 40, 0 };
                    else
                    {
                        Purity[0] = alvl;
                        Purity[4] = auraPur1[(int)alvl - 1];
                    }
                    break;
                case "PurityofFire":
                    if (alvl < 1)
                        PurFire = new decimal[] { 0, 100, 0, 40, 0, 0 };
                    else
                    {
                        PurFire[0] = alvl;
                        PurFire[4] = auraPur2[(int)alvl - 1];
                        PurFire[5] = auraPur3[(int)alvl - 1];
                    }
                    break;
                case "PurityofIce":
                    if (alvl < 1)
                        PurCold = new decimal[] { 0, 100, 0, 40, 0, 0 };
                    else
                    {
                        PurCold[0] = alvl;
                        PurCold[4] = auraPur2[(int)alvl - 1];
                        PurCold[5] = auraPur3[(int)alvl - 1];
                    }
                    break;
                case "PurityofLightning":
                    if (alvl < 1)
                        PurLight = new decimal[] { 0, 100, 0, 40, 0, 0 };
                    else
                    {
                        PurLight[0] = alvl;
                        PurLight[4] = auraPur2[(int)alvl - 1];
                        PurLight[5] = auraPur3[(int)alvl - 1];
                    }
                    break;
                case "Vitality":
                    if (alvl < 1)
                        Vitality = new decimal[] { 0, 100, 0, 40, 0 };
                    else
                    {
                        Vitality[0] = alvl;
                        Vitality[4] = auraVita[(int)alvl - 1];
                    }
                    break;
                case "TempestShield":
                    if (alvl < 1)
                        TempShld = new decimal[] { 0, 100, 0, 25, 0, 0, 0 };
                    else
                    {
                        TempShld[0] = alvl;
                        TempShld[4] = auraTem1[(int)alvl - 1];
                        TempShld[5] = auraTem2[(int)alvl - 1];
                        TempShld[6] = 4;
                    }
                    break;                    
            }
        }

        public string[] strAuraEffects(string AuraName)
        {
            string[] effects = new string[] { "0", "0", "0" };
            decimal[] temp = decAuraEffects(AuraName);
            effects[0] = temp[0].ToString();
            effects[1] = temp[1].ToString();
            effects[2] = temp[2].ToString();
            return effects;
        }

        public decimal[] decAuraEffects(string AuraName)
        {
            decimal[] effects = new decimal[] { 0,0,0 };
            decimal buffstr = 1;
            if (auraStrength.Sum() > 0 || buffStrength.Sum() >0) 
                buffstr = buffstr +(auraStrength.Sum() + buffStrength.Sum()) / 100;

            // 4 = eff1, 5 = eff2, 6 = eff3
            switch (AuraName)
            {
                case "Anger":
                    effects[0] = Anger[4] * buffstr;
                    effects[1] = Anger[5] * buffstr;
                    break;
                case "Clarity":
                    effects[0] = Clarity[4] * buffstr;
                    break;
                case "Determination":
                    effects[0] = Determination[4] * buffstr;
                    break;
                case "Discipline":
                    effects[0] = Discipline[4] * buffstr;
                    break;
                case "Grace":
                    effects[0] = Grace[4] * buffstr;
                    break;
                case "Haste":
                    effects[0] = Haste[4] * buffstr;
                    effects[1] = Haste[5] * buffstr;
                    effects[2] = Haste[6] * buffstr;
                    break;
                case "Hatred":
                    effects[0] = Hatred[4] * buffstr;
                    break;
                case "Purity":
                    effects[0] = Purity[4] * buffstr;
                    break;
                case "PurityofFire":
                    effects[0] = PurFire[4] * buffstr;
                    effects[1] = PurFire[5] * buffstr;
                    break;
                case "PurityofIce":
                    effects[0] = PurCold[4] * buffstr;
                    effects[1] = PurCold[5] * buffstr;
                    break;
                case "PurityofLightning":
                    effects[0] = PurLight[4] * buffstr;
                    effects[1] = PurLight[5] * buffstr;
                    break;
                case "Vitality":
                    effects[0] = Vitality[4] * buffstr;                    
                    break;
                case "TempestShield":
                    effects[0] = TempShld[4] * buffstr;
                    effects[1] = TempShld[5] * buffstr;
                    effects[2] = TempShld[6];
                    break;
            }
            return effects;
        }

        public string strAuraCost(string AuraName)
        {
            decimal te = 0, rr = 100 - reducedReserve.Sum();
            //bc = BASE cost (40%, 60%), rma = reduced mana %, bmc = blood mana %            
            decimal bc, rma, bmc;

            switch (AuraName)
            {
                // 0 = level, 1 = reduced amount, 2 = blood magic amount, 3=base cost%, 4 = eff1, 5 = eff2, 6 = eff3
                case "Anger":
                    bc = Anger[3];    
                    rma = Anger[1];
                    bmc = Anger[2];
                    break;
                case "Clarity":
                    bc = Clarity[3];
                    rma = Clarity[1];
                    bmc = Clarity[2];
                    break;
                case "Determination":
                    bc = Determination[3];
                    rma = Determination[1];
                    bmc = Determination[2];
                    break;
                case "Discipline":
                    bc =  Discipline[3];
                    rma = Discipline[1];
                    bmc = Discipline[2];
                    break;
                case "Grace":
                    bc = Grace[3];
                    rma = Grace[1];
                    bmc = Grace[2];
                    break;
                case "Haste":
                    bc = Haste[3];
                    rma = Haste[1];
                    bmc = Haste[2];
                    break;  
                case "Hatred":
                    bc = Hatred[3];
                    rma = Hatred[1];
                    bmc = Hatred[2];
                    break;
                case "Purity":
                    bc =  Purity[3];
                    rma = Purity[1];
                    bmc = Purity[2];
                    break;
                case "PurityofFire":
                    bc = PurFire[3];
                    rma = PurFire[1];
                    bmc = PurFire[2];
                    break;
                case "PurityofIce":
                    bc = PurCold[3];
                    rma = PurCold[1];
                    bmc = PurCold[2]; 
                    break;
                case "PurityofLightning":
                    bc = PurLight[3];
                    rma = PurLight[1];
                    bmc = PurLight[2];
                    break;
                case "Vitality":
                    bc = Vitality[3];
                    rma = Vitality[1];
                    bmc = Vitality[2];
                    break;
                case "TempestShield":
                    bc = TempShld[3];
                    rma = TempShld[1];
                    bmc = TempShld[2];
                    break;
                default:
                    bc = Anger[3];    
                    rma = Anger[1];
                    bmc = Anger[2];
                    break;
            }            
            if (BM == 1)
            {
                // .6 (m=decimal) is for the 40% reduction from the node behind BM
                //MessageBox.Show("BMx decLifeFinal()*.6: " + decLifeFinal() * .6m);
                te = decLifeFinal() * (bc / 100) * (rma / 100) * (rr/100) * .6m;
                //MessageBox.Show("BM3.\n te: "+te+" life: " + decLifeFinal().ToString() + "bc :" + bc + " rma: " + rma + "rr: " + rr);
                if(AuraName == "Clarity")
                    te = bc * (rma / 100) * (rr / 100) * .6m;
            }                
            else if (bmc > 100) // Life
            {

                te = decLifeFinal() * (bc / 100) * (rma / 100) * (bmc / 100) * (rr / 100) ;
                if (AuraName == "Clarity")
                    te = bc * (rma / 100) * (bmc/100) * (rr / 100);

            }
            else // mana
            {
                te = decManaFinal() * (bc/100) * (rma/100) * (rr/100);
                if (AuraName == "Clarity") 
                    te = bc * (rma / 100) * (rr / 100);

            }
            return te.ToString("0");
        }

        // DPS CALCS
        public string strAcc()
        {
            decimal temp = 0;
            temp = temp + Convert.ToDecimal(strStatsAcc()) + accAdd.Sum();
            temp = temp * (1 + (accAddP.Sum() / 100));
            return temp.ToString();
        }

        public string strBaseAPS()
        {
            return baseAPS.ToString();
        }

        public string strBaseCast()
        {
            return baseCastTime.ToString();
        }

        public string strAttackSpeed()
        {
            decimal temp = attackSpeed.Sum();
            if (DW == 1) 
                temp = temp * (decimal)1.1;
            return temp.ToString() + "%";
        }
        public string strCastSpeed()
        {
            decimal temp = castSpeed.Sum();            
            return temp.ToString() + "%";
        }
        public decimal decDWAPS()
        {
            // WHEN YOU FIX THIS LATER:
            // final DW APS = (main+off)/2  * 1.1 * multistrike % * (1+total AS%/100)
            return ((mainHAPS + offHAPS) / 2) * (decimal)1.1;
        }
        public string strAPS()
        {
            decimal temp = mainHAPS, AS = attackSpeed.Sum();
            if (DW == 1) 
                temp = decDWAPS();
            // MULTISTRIKE GOES HERE, SOMEDAY
            temp = temp * (1 + AS / 100);
            return temp.ToString("0.00");
        }
        public string strCastTime()
        {
            decimal temp = baseCastTime, CS = castSpeed.Sum();
            temp = 1 / temp; // convert cast time -> casts per second
            temp = temp * (1 + CS / 100); // casts per second with cast speed applied
            temp = 1 / temp; // convert back to cast time
            return temp.ToString("0.00");
        }

        public string strBaseCritAtk()
        {
            return baseCritAtk.ToString() + "%";
        }
        public string strBaseCritSpell() 
        { 
            return baseCritSpell.ToString() + "%"; 
        }
        public string strCritPAtk()
        {
            return (critP.Sum() + critWeaponP.Sum()).ToString()+"%";
        }
        public string strCritPSpell()
        {
            return (critP.Sum() + critSpellP.Sum()).ToString() + "%";
        }
        public string strCritMAtk()
        {
            return (critMultP.Sum() + critMultWeaponP.Sum()).ToString() + "%";
        }
        public string strCritMSpell()
        {
            return (critMultP.Sum() + critMultSpellP.Sum()).ToString() + "%";
        }
        public string strAtkCritChance()
        {
            decimal temp = baseCritAtk;
            temp = temp * (1 + (critP.Sum() + critWeaponP.Sum()) / 100);
            return temp.ToString() + "%";
        }
        public string strSpellCritChance()
        {
            decimal temp = baseCritSpell;
            temp = temp * (1 + (critP.Sum() + critSpellP.Sum()) / 100);
            return temp.ToString() + "%";
        }
        public string strAtkCritMult()
        {
            decimal temp = baseCritMult;
            temp = temp + (critMultP.Sum() + critMultWeaponP.Sum());
            return temp.ToString() + "%";
        }
        public string strSpellCritMult()
        {
            decimal temp = baseCritMult;
            temp = temp + (critMultP.Sum() + critMultSpellP.Sum());
            return temp.ToString() + "%";
        }

    }
}
